﻿'Params
'track (Required) : The track name.
'artist (Required) : The artist name.
'album (Optional) : The album name.
'albumArtist (Optional) : The album artist - if this differs from the track artist.
'context (Optional) : Sub-client version (not public, only enabled for certain API keys)
'trackNumber (Optional) : The track number of the track on the album.
'mbid (Optional) : The MusicBrainz Track ID.
'duration (Optional) : The length of the track in seconds.
'api_key (Required) : A Last.fm API key.
'api_sig (Required) : A Last.fm method signature. See authentication for more information.
'sk (Required) : A session key generated by authenticating a user via the authentication protocol.
'    Auth()
'This service requires authentication. Please see our authentication how-to.
'This is a write service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See rest requests for more information. 

Public Structure TrackUpdateNowPlayingResponse

End Structure

Public Class TrackUpdateNowPlaying
	Inherits BaseRequest
    Dim artist As String = ""
    Dim album As String = ""
    Dim mbid As String = ""
    Dim lang As String = ""
    Dim autocorrect As String = ""
    Dim page As String = ""
    Dim limit As String = ""

	Public xmlresponse As XDocument = Nothing

	Public Sub New()
        Me.artist = artist
        Me.album = album
        Me.mbid = mbid
        Me.lang = lang
        Me.autocorrect = autocorrect
        Me.page = page
        Me.limit = limit
	End Sub

	Public Sub sendRequest()
        InitializeMembers("album.getInfo")
        AddMember("artist", artist, String.IsNullOrEmpty(mbid))
        AddMember("album", album, String.IsNullOrEmpty(mbid))
        AddMember("mbid", mbid, False)
        AddMember("lang", lang, False)
        AddMember("autocorrect", autocorrect, False)
		AddMember("username", My.Settings.user_name, False)
        AddMember("api_key", My.Settings.api_key, False)
        xmlresponse = sendPOSTResponse(True)
    End Sub

    Public Function getResponse() As TrackUpdateNowPlayingResponse
        Dim response As New TrackUpdateNowPlayingResponse
        'response.album = New Album(xmlresponse.<lfm>.<album>.First)
        Return response
    End Function
End Class
